package com.jsmile.cloud.promotioncenter.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 支付类型(枚举)
 *
 * @author Morily
 */
@Getter
@AllArgsConstructor
public enum GroupTypeEnum {

    DEFAULT(0, "默认"), NEW(1, "新人专享"),;

    /**
     * 值
     */
    private int value;
    private String name;

    /**
     * 根据value获取 名称
     */
    public static GroupTypeEnum nameOf(int value) {
        GroupTypeEnum type = null;
        for (GroupTypeEnum rt : GroupTypeEnum.values()) {
            if (rt.getValue() == value) {
                type = rt;
                break;
            }
        }
        return type;
    }
}
